module shader.matshadermulticolor;

import shader.abstractshader;
import scene.scene;
import scene.ray;
import scene.intersection;
import utils.color;

class MatShaderMultiColor: AbstractShader {
    public void getColor(inout Ray ray, inout Intersection inters,
        inout RGBColor col)
    {
        col.r = 0;
        col.g = (cast(float)inters.triIdx)/mScene.triCount();
        col.b = inters.t/1000.0f;
    }

    public char[] toString() {
        return "Combined triangle index/distance";
    }
}

